package com.young.rpc.server;
import com.sun.net.httpserver.HttpHandler;

import java.util.Map;

/**
 * @description：
 * @author: yangyahui01
 * @date: 11/25/24 3:38 PM
 */
public interface RpcServer {

    void start();

    void start(boolean daemon);

    void stop();

    boolean isAlive();

    int getPort();

    void handlerMapping(Map<String, HttpHandler> handlerMapping);

    interface Builder {
        Builder daemon(boolean daemon);
        Builder port(int port);
        Builder handler(Map<String, HttpHandler> handlerMapping);
        RpcServer build() throws Exception;
    }
}
